<?php

App::uses('AppModel', 'Model');

class Receipe extends AppModel {
	
	public $hasMany = array( 'ReceipeMaterial', 'ReceipePrepare' );
	
    public function deleteRelatedData() {
        if ($this->id) {
            $this->ReceipeMaterial->deleteAll(array('ReceipeMaterial.receipe_id' => $this->id));
            $this->ReceipePrepare->deleteAll(array('ReceipePrepare.receipe_id' => $this->id));
        }
    }
}

?>
